<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>跑马灯</title>
</head>
<body>

	<div id="div">
		<h3 v-html="res"></h3>
	</div>
	<script src="vue.js"></script>
	<script>
		const vm=new Vue({
			el:'#div',
			data:{
				title:'爱上对方过后就哭了',
				res:''
			},
			methods:{
				run(){
					let i=0;
					setInterval(()=>{
						let arr = this.title.split('');
						let str = '<span style="color:red;font-size:25px;">'+arr[i]+'</span>';
						arr[i] = str;					
						this.res = arr.join('');

						i++;
						if(i == arr.length){
							i = 0;
						}
					},500)
				}
			}
		})
		vm.run()
	</script>

</body>
</html>